<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>三方手续费管理</title>
	<jsp:include page="../../import.jsp" flush="true" />
	<script type="text/javascript">
		$(function () {
			initForm();
			saveEvent();
		});

		//初始化表单
		function initForm(){
			$("#formSet1").ligerForm({
				validate: true
			});
		}
		//保存事件
		function saveEvent(){
			$("#saveBtn1").click(function(event) {
				var form = liger.get("formSet1");
				if (!form.valid()) {
					top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
					return false; //验证不通过，不执行以下代码
				}
				var data = form.getData();
				var url = '<%=path%>/custpay/cmsPayComm/modifyCmsPayComm.do';
				var wait_dialog;
				$.ajax({
					type: 'post',
					dataType:'json',
					data:data,
					url: url,
					beforeSend: function(){
						wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
					},
					success:function(msg){
						wait_dialog.close();
						if(msg.success == 1){
							top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
							var callback=GET_W2Wcallback();
							callback();
							Remove_navTab ();
						}else{
							top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
						}
					}
				});
			});
		}
	</script>
</head>
<body class="iframeBody">
<div class="Wrapper">
	<form id="formSet1">
		<table class="layout2col1">
			<tbody>
			<tr>
				<td valign="top">
					<div class="fieldset1 tabel_col clearFix">
						<div class="fieldBox col_100_auto">
							<div class="label">所属事业部</div>
							<div class="field">
								<select name="isdept"  id="isdept"  disabled="disabled">
									<option value=" " selected="selected">--请选择--</option>
									<option value="0000" <c:if test="${cmspaycomm.isdept == '0000'}">selected</c:if>>狮桥融资租赁</option>
									<c:forEach items="${orglist}" var="opt">
										<option value="${opt.key}" <c:if test="${cmspaycomm.isdept == opt.key}">selected</c:if>>${opt.value}</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">信联最低收取</div>
							<div class="field">
								<input name="xlMin" id="xlMin" type="text" class="ui-textbox" value="${cmspaycomm.xlMin}" validate="{required:true}">元
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">信联手续费百分比</div>
							<div class="field">
								<input name="xlRate" id="xlRate" type="text" class="ui-textbox" value="${cmspaycomm.xlRate}" validate="{required:true}">%
							</div>
						</div>
						<div class="fieldBox col_33">
							<div class="label">信联最高收取</div>
							<div class="field">
								<input name="xlMax" id="xlMax" type="text" class="ui-textbox" value="${cmspaycomm.xlMax}" validate="{required:true}">元
							</div>
						</div>
						<div class="fieldBox col_100_auto">
							<div class="label">手续费支付类型</div>
							<div class="field">
								<c:choose>
									<c:when test="${not empty cmspaycomm && cmspaycomm.paySide==1}">
										狮桥支付<input type="radio" name="paySide" value="0">&nbsp;&nbsp;
										用户支付<input type="radio" name="paySide" value="1" checked>
									</c:when>
									<c:otherwise>
										狮桥支付<input type="radio" name="paySide" value="0" checked>&nbsp;&nbsp;
										用户支付<input type="radio" name="paySide" value="1" >
									</c:otherwise>
								</c:choose>
							</div>
						</div>
						<div class="fieldBox col_100_auto">
							<div class="label">用户支付短语</div>
							<div class="field">
								<input name="usrPayStr" id="usrPayStr" type="text" ligerui="width:700" class="ui-textbox" value="${cmspaycomm.usrPayStr}" validate="{required:true}"> 请用“X”代替金额
							</div>
						</div>
						<div class="fieldBox col_100_auto">
							<div class="label">狮桥支付短语</div>
							<div class="field">
								<input name="sqPayStr" id="sqPayStr" type="text" ligerui="width:700" class="ui-textbox" value="${cmspaycomm.sqPayStr}" validate="{required:true}"> 请用“X”代替金额
							</div>
						</div>
						<div class="fieldBox col_100_auto">
							<div class="label">免费支付短语</div>
							<div class="field">
								<input name="freePayStr" id="freePayStr" type="text" ligerui="width:700" class="ui-textbox" value="${cmspaycomm.freePayStr}" validate="{required:true}"> 请用“X”代替金额
							</div>
						</div>
					</div>

					<div id="btnsBox" class="btnsBox">
						<input name="cmspayId" id="cmspayId" type="text" style="display: none;" value="${cmspaycomm.id}"/>
						<span id="saveBtn1" class="sq-button sq-button-round">保存</span>
						<input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
					</div>
				</td>
			</tr>
			</tbody>
		</table>
	</form>
</div>
<div class="clearLine"></div>
</body>
</html>